#ifndef ns_pong_h
#define ns_pong_h

#include "agent.h"
#include "tclcl.h"
#include "packet.h"
#include "address.h"
#include "ip.h"

struct hdr_pong {
	char ret;
	double send_time;
 	double rcv_time;	// when pong arrived to receiver
 	int seq;		// sequence number


	// Header access methods
	static int offset_; // required by PacketHeaderManager
	inline static int& offset() { return offset_; }
	inline static hdr_pong* access(const Packet* p) {
		return (hdr_pong*) p->access(offset_);
	}
};

class PongAgent : public Agent {
public:
	PongAgent();
 	int seq;	// a send sequence number like in real pong
	int oneway; 	// enable seq number and one-way delay printouts
	virtual int command(int argc, const char*const* argv);
	virtual void recv(Packet*, Handler*);
};

#endif // ns_pong_h
